<template>
  <div class="children">
    <el-dialog title="保养标准" :visible.sync="$parent.openObject" width="75%">
      <el-divider>基本信息</el-divider>
      <el-descriptions direction="vertical" :column="8" border size="medium">
        <el-descriptions-item label="设备编号">{{ eaPartInfoVo.equipmentNum || '-' }}</el-descriptions-item>
        <el-descriptions-item label="设备名称">{{ eaPartInfoVo.equipmentName || '-' }}</el-descriptions-item>
        <el-descriptions-item label="品牌">{{ eaPartInfoVo.brand || '-' }}</el-descriptions-item>
        <el-descriptions-item label="规格型号">{{ eaPartInfoVo.model || '-' }}</el-descriptions-item>

        <el-descriptions-item label="供应商">{{ eaPartInfoVo.supplierName || '-' }}</el-descriptions-item>
        <el-descriptions-item label="单位">{{ eaPartInfoVo.unitName || '-' }}</el-descriptions-item>
        <el-descriptions-item label="类别">{{ eaPartInfoVo.typeName || '-' }}</el-descriptions-item>

        <el-descriptions-item label="备注">{{ eaPartInfoVo.remark || '-' }}</el-descriptions-item>
      </el-descriptions>
      <el-divider>保养标准</el-divider>
      <el-table :data="ObjData.upkeepTypes" v-loading="loading">
        <el-table-column label="序号" align="center" width="50">
          <template slot-scope="scope">
            {{ scope.$index + 1 }}
          </template>
        </el-table-column>
        <el-table-column label="编号" align="center" prop="noticeType" min-width="130">
          <template slot-scope="scope">
            {{ scope.row.typeNum || '-' }}
          </template>
        </el-table-column>
        <el-table-column label="名称" align="center" min-width="120">
          <template slot-scope="scope">
            {{ scope.row.typeName || '-' }}
          </template>
        </el-table-column>
        <el-table-column label="周期" align="center" min-width="120">
          <template slot-scope="scope">
            {{ ['一日', '一周', '十五日', '一月', '三月', '六月', '十二月', '不定'][scope.row.cycle] || '-' }}
          </template>
        </el-table-column>
        <el-table-column label="排序" align="center" min-width="120">
          <template slot-scope="scope">
            {{ scope.row.sort || '-' }}
          </template>
        </el-table-column>
        <!-- <el-table-column label="状态" align="center" min-width="120">
            <template slot-scope="scope">
              <dict-tag :options="statusFlag" :value="scope.row.status" />
            </template>
          </el-table-column> -->
        <el-table-column label="备注" align="center" min-width="180">
          <template slot-scope="scope">
            {{ scope.row.remark || '-' }}
          </template>
        </el-table-column>
      </el-table>
      <div align="center" slot="footer" class="dialog-footer">
        <el-button @click="() => $parent.openObject = false">关闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { getSelectChildrenandUpkeepProject } from '@/api/maintenance/insurance/insurance.js'
export default {
  props: ['row'],
  data () {
    return {
      ObjData: {},
      eaPartInfoVo: {},
      loading: false,
      noticeList: []
    }
  },
  created () {
    this.getlist()
  },
  methods: {
    /**
     * 初始化
     */
    async getlist () {
      // this.noticeList = this.row
      this.loading = true
      let params = {
        equipmentAccountId: this.row.equipmentAccountId,
        upkeepPlanId: this.row.upkeepPlanId,
      }
      let { data: data } = await getSelectChildrenandUpkeepProject(params)
      this.ObjData = data
      this.eaPartInfoVo = data.eaPartInfoVo
      this.loading = false
    }
  }
}
</script>

<style lang="scss" scoped>
::v-deep .descript .is-bordered {
  table-layout: fixed
}
</style>